<?php
class dataBaseConnection 
{
    //constructor
    public function __construct($dbAddress, $dbUser, $dbPassword, $dbTable)
    {
        $dbConnection = mysqli_connect($dbAddress, $dbUser, $dbPassword);
        if(false === $dbConnection)
        {
            die(mysqli_connect_error());
        }
        
        mysqli_select_db($dbConnection, $dbTable);
        
        $this->DbConnection = $dbConnection;
    }
    
    public $DbConnection;
  
    public  function disconnectDB()
    {
        mysqli_close($this->DbConnection);  
    }
 
    public function query($query)
    {
        $result = mysqli_query($this->DbConnection, $query);
        return $result;
    }
    
    public function lastID()
    {
        $result = mysqli_insert_id($this->DbConnection);
        return $result; 
    }  
}
